package com.lizhi.yun.db.rsz.entity;/**
 * @program: hbsf
 * @name RszPatientEntity
 * @description:
 * @author: lizhi
 * @create: 2021-08-12 15:35
 */

import com.lizhi.common.yun.enums.UppCerTypeEnum;
import com.lizhi.common.yun.enums.UppSexEnum;
import com.lizhi.mybatis.boot.Description;
import lombok.Data;
import lombok.ToString;

import javax.persistence.*;

/**
 *@program: hbsf
 *@name RszPatientEntity
 *@description: 患者信息
 *@author: lizhi
 *@create: 2021-08-12 15:35
 */
@Data
@ToString
@Table(name = "rsz_patient")
@Entity
@Description("患者信息表")
public class RszPatientEntity extends AbstractVrEntity {

    @Id
    @Column(columnDefinition="varchar(30) COMMENT 'lid'")
    @Description("lid")
    public String lid;

    @Column(columnDefinition="varchar(30) COMMENT '患者id'")
    public String ptId;

    @Column(columnDefinition="varchar(500) COMMENT '患者姓名'")
    public String ptNm;

    /**
     * @see com.lizhi.common.yun.enums.UppSexEnum
     */
    @Column(columnDefinition="varchar(2) COMMENT '患者性别'")
    public String ptSex;

    @Transient
    public String ptSexText;

    @Column(columnDefinition="varchar(500) COMMENT '患者年龄'")
    public String ptAge;

    /**
     * @see com.lizhi.common.yun.enums.UppCerTypeEnum
     */
    @Column(columnDefinition="varchar(2) COMMENT '患者证件类型'")
    public String ptCerTp;

    @Transient
    public String ptCerTpText;

    @Column(columnDefinition="varchar(500) COMMENT '患者证件号码'")
    public String ptCerNo;

    @Column(columnDefinition="varchar(500) COMMENT '患者证件出生日期'")
    public String ptBirth;

    @Column(columnDefinition="varchar(500) COMMENT '患者证件手机号'")
    public String ptPhone;

    @Column(columnDefinition="varchar(500) COMMENT '患者身高（cm）'")
    public String ptHeight;

    @Column(columnDefinition="varchar(4000) COMMENT '患者地址'")
    public String ptAddress;

    @Column(columnDefinition="varchar(500) COMMENT '患者设置的画笔颜色（例：#666666）'")
    public String ptColor;

    public String getPtSexText() {
        if (UppSexEnum.SEX_00.getEnValue().equals(ptSex)){
            ptSexText = UppSexEnum.SEX_00.getEnName();
        } else if (UppSexEnum.SEX_01.getEnValue().equals(ptSex)){
            ptSexText = UppSexEnum.SEX_01.getEnName();
        }
        return ptSexText;
    }

    public String getPtCerTpText() {
        if(UppCerTypeEnum.CER_TYPE_00.getEnValue().equals(ptCerTp)){
            ptCerTpText = UppCerTypeEnum.CER_TYPE_00.getEnName();
        } else if(UppCerTypeEnum.CER_TYPE_01.getEnValue().equals(ptCerTp)){
            ptCerTpText = UppCerTypeEnum.CER_TYPE_01.getEnName();
        }
        return ptCerTpText;
    }
}
